
<template>
  <a-row :gutter="10">
    <a-col :md="6" :sm="24" >
      <a-card :bordered="false" style="height:900px">
          <a-tree
            showLine
            :expandedKeys="expandedKeys"
            @select="onSelect"
            :treeData="treeData"
            :autoExpandParent="true"
            @expand="onExpand"
          />

      </a-card>
    </a-col>
    <a-col :md="18" :sm="24">
      <a-card :bordered="false" style="height:900px">

        <reply-list ref="ReplyList" ></reply-list>
      </a-card>
    </a-col>
  </a-row>
</template>



<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  // import EmployeeModal from './EmployeeModal'
  import ReplyList from './ReplyList'
  import { getAction } from '../../../api/manage'
  import { FormMixin } from '@/mixins/FormMixin'
  import { requestSetData } from '../../../utils/commonUtils'

  export default {
    name: 'RelyMainList',
    mixins: [ mixinDevice,FormMixin],
    components: {
      ReplyList

    },
    data() {
      return {
        description: '',
        expandedKeys:[],
        treeData:[],
      }
    },
    created() {


      let $this = this;
      requestSetData("/blog/article/listTree",{},function(data){
        $this.treeData = data;
        $this.treeData.forEach(data=>{
          $this.expandedKeys.push(data.key);
        })
      });
    },
    computed: {

    },
    methods: {
      initDictConfig() {
      },
      onSelect(selectedKeys, e) {
        console.log(selectedKeys)

        let record = e.node.dataRef;
        console.log("record="+record);
        this.$refs.ReplyList.initRefresh(selectedKeys[0]);
      },

      onExpand(expandedKeys) {
        console.log("expandedKeys="+expandedKeys)
        this.expandedKeys = expandedKeys
      },
      expand(expanded, record) {

      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>